<form class="form-horizontal adminex-form" action="" method="post" enctype="multipart/form-data">
    <input type="hidden" name="id" value="{$category.id}" id="idxg">
    {if condition="$category['parent_id'] neq '0'"}
    <div class="form-group" id="levelst2">


        <label class="col-sm-2 col-sm-2 control-label">一级类别:</label>
        <div class="col-lg-10">

            <select class="form-control input-sm m-bot15 ipt4" name="level" id="leveltopxg" onchange="showxg()">
                <option value="{$category.parent_id}">{:getlevel($category['parent_id'])}</option>
                {volist name="level" id="vo"}

                {if condition="$vo['parent_id'] eq '0'"}
                <option value="{$vo.id}">{$vo.level}</option>
                {/if}
                {/volist}
            </select>

        </div>
    </div>

    <div class="form-group" id="ferror2xg">
        <label class="col-sm-2 col-sm-2 control-label" id="levellb2">二级类别:</label>
        <div class="col-sm-10">
            <input type="text" id="levelxg" value="{$category.level}" class="form-control ipt4">
            <div id="error1" class="error"></div>
        </div>
    </div>
    {else /}


    <div class="form-group" id="ferror2xg">
        <label class="col-sm-2 col-sm-2 control-label" id="levellb2">一级类别:</label>
        <div class="col-sm-10">
            <input type="hidden" id="leveltopxg" value="0">
            <input type="text" id="levelxg" value="{$category.level}" class="form-control ipt4">
            <div id="error1" class="error"></div>
        </div>
    </div>
    {/if}
</form>